{% extends "base.html" %}
{% load promgen %}
{% load i18n %}
{% block content %}

<div class="page-header">
  <h1>Rules</h1>
</div>

{% breadcrumb label="List Rules" %}
{% include "promgen/pagination_short.html" %}
{% regroup rule_list by content_object as grouped_rule_list %}

{% for group in grouped_rule_list %}
<div class="panel panel-default">
  <div class="panel-heading" v-pre>
    <a href="{{ group.grouper.get_absolute_url }}">{{ group.grouper }}</a>
    <a href="{% url 'rule-new' group.grouper|klass|lower group.grouper.id %}" class="btn btn-primary btn-xs pull-right">{% trans "Register Rule" %}</a>
  </div>

  <table class="table table-bordered table-condensed">
    {% include "promgen/rule_header.html" %}
    {% include "promgen/rule_block.html" with rule_list=group.list %}
  </table>
</div>
{% endfor %}
{% include "promgen/pagination_short.html" %}
{% endblock %}
